﻿#ifndef _OI_PLSCANNERCORE_PRODUCTDLG_HPP_
#define _OI_PLSCANNERCORE_PRODUCTDLG_HPP_

#include "PLScannerCore/OiPLScannerCore.hpp"

namespace Oi
{
    namespace PLScannerCore
    {
        class ListItemLabel : public QLabel
        {
        public:
            ListItemLabel(QWidget* parent = NULL);

        public:
            void setDispText(const QString& t);
            bool containsText(const QString& t, int* start = NULL, int* lenth = NULL);
            void setSelectText(const QString& st);

        public:
            QString _text;
        };

        class OI_PLSCANNER_CORE_API ProductDlg : public Ctrl::Dialog
        {
            Q_OBJECT

        public:
            ProductDlg(ProductMeasurePage type = PMP_ThicknessMeasure, QWidget* parent = NULL);

        public slots:
            void updatePage();
            void setCurrent(QString name);

        protected:
            void closeEvent(QCloseEvent *e);

        private slots:
            void on__searchName_textChanged(const QString &);
            void on__clearSearch_clicked();

            void on__formulaList_currentRowChanged(int);
            void on__formulaList_itemDoubleClicked(QListWidgetItem*);

            void on__importButton_clicked();
            void on__appendButton_clicked();
            void on__modifyButton_clicked();
            void on__deleteButton_clicked();
            void on__completeButton_clicked();
            void on__cancelButton_clicked();

        public:
            OI_DECLARE_IMPL(ProductDlg);
            OI_DISABLE_COPY(ProductDlg);


        };
    }
}

#endif
